package com.scu.hotelsystem.service;

import com.github.pagehelper.PageHelper;
import com.scu.hotelsystem.dao.GoodsOrderDao;
import com.scu.hotelsystem.pojo.GoodsOrder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
@Service
@Transactional
public class GoodsOrderServiceImpl implements GoodsOrderService {

    @Autowired
    private GoodsOrderDao goodsOrderDao;
    @Override
    public List<GoodsOrder> findAll(int page, int size) throws Exception {
        //参数pageNum 是页码值   参数pageSize 代表是每页显示条数
        PageHelper.startPage(page, size);
        return goodsOrderDao.findAll();
    }

    @Override
    public GoodsOrder findById(Integer ordersId) throws Exception{
        return goodsOrderDao.findById(ordersId);}
}
